namespace IAM.Interface.Model
{
    using IAM.Interface.Common;
    using IAM.Interface.Model.Interface;
    using System;
    using System.Text;

    [Serializable]
    public class Result : AbstractConvertObject, IConvertXml
    {
        private string _errorcode = "";
        private string _errormessage = "";

        public override object ConvertToObject()
        {
            this.ErrorCode = EnDeCoding.Decode(this.CurrentXmlNode.Attributes["ErrorCode"].InnerText);
            this.ErrorMessage = EnDeCoding.Decode(this.CurrentXmlNode.Attributes["ErrorMessage"].InnerText);
            return this;
        }

        public string ErrorCode
        {
            get
            {
                return this._errorcode;
            }
            set
            {
                this._errorcode = value;
            }
        }

        public string ErrorMessage
        {
            get
            {
                return this._errormessage;
            }
            set
            {
                this._errormessage = value;
            }
        }

        public string XML
        {
            get
            {
                return (this.XMLBoday + this.XMLFinis);
            }
        }

        public string XMLBoday
        {
            get
            {
                StringBuilder _xml = new StringBuilder();
                _xml.Append("<Result");
                _xml.Append(" ErrorCode=\"" + EnDeCoding.Encode(this.ErrorCode) + "\"");
                _xml.Append(" ErrorMessage=\"" + EnDeCoding.Encode(this.ErrorMessage) + "\"");
                _xml.Append("  />");
                return _xml.ToString();
            }
        }

        public string XMLFinis
        {
            get
            {
                return "";
            }
        }
    }
}

